/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.longview.io.modules.sms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.longview.io.common.persistence.Page;
import com.longview.io.common.service.CrudService;
import com.longview.io.modules.sms.entity.SmsInfo;
import com.longview.io.modules.sms.dao.SmsInfoDao;

/**
 * 短信验证码Service
 * @author 张飞
 * @version 2017-03-27
 */
@Service
@Transactional(readOnly = true)
public class SmsInfoService extends CrudService<SmsInfoDao, SmsInfo> {
	@Autowired
	private SmsInfoDao smsInfoDao;
	
	public SmsInfo get(String id) {
		return super.get(id);
	}
	
	public List<SmsInfo> findList(SmsInfo smsInfo) {
		return super.findList(smsInfo);
	}
	
	public Page<SmsInfo> findPage(Page<SmsInfo> page, SmsInfo smsInfo) {
		return super.findPage(page, smsInfo);
	}
	
	@Transactional(readOnly = false)
	public void save(SmsInfo smsInfo) {
		super.save(smsInfo);
	}
	
	@Transactional(readOnly = false)
	public void delete(SmsInfo smsInfo) {
		super.delete(smsInfo);
	}
	//根据手机号和验证码查询是否存在
	public SmsInfo findByMobileAndCode(SmsInfo smsInfo)
	{
		return smsInfoDao.findByMobileAndCode(smsInfo);
	}
	//
	@Transactional(readOnly = false)
	public int updateByMobileAndCode(SmsInfo smsInfo)
	{
		return smsInfoDao.updateByMobileAndCode(smsInfo);
	}
}